<template>
  <ph-view>
    <ph-blockquote type="primary">该组件为独立组件<br/><a href="https://www.npmjs.com/package/ph-toast" target="_blank">npm 地址</a></ph-blockquote>
    <ph-divider>基本介绍</ph-divider>
    <ph-pretty>{{ baseUsage }}</ph-pretty>
    <ph-button @click="onClick">打开toast</ph-button>
    <ph-button type="success" @click="onClick1()">打开toast</ph-button>
    <ph-button type="danger" @click="onClick2()">打开toast</ph-button>
    <ph-pretty>{{ demo1 }}</ph-pretty>
  </ph-view>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { PhDivider, PhBlockquote, PhButton, PhView } from "@/index";
import PhToast from 'ph-toast'
import * as Data from "../data/toast";
export default defineComponent({
  components: { PhDivider, PhButton, PhView ,PhBlockquote },
  setup() {
    const onClick = () => PhToast.show("我爱你，中国");
    const onClick1 = () => PhToast.success("操作成功");
    const onClick2 = () => PhToast.danger("接口异常");
    return { onClick,onClick1,onClick2, ...Data };
  },
});
</script>
